/*
 * @Descripttion:操作数据库
 * @version: 
 * @Author: 一氧化二氢
 * @Date: 2022-01-01 11:50:38
 * @lastEditorTime: Do no edit
*/
const { Sequelize } = require('sequelize')
// 导入数据库配置
const { MYSQL_HOST,
    MYSQL_PORT,
    MYSQL_USER,
    MYSQL_PWD,
    MYSQL_DB } = require('../config/config.default')

const seq = new Sequelize(MYSQL_DB, MYSQL_USER, MYSQL_PWD, {
    host: MYSQL_HOST,
    dialect: "mysql",
})

//测试数据库连接
/* seq.authenticate().then(() => {
    console.log("数据库连接成功")
}).catch(err => {
    console.log("数据库连接失败", err)
}) */

module.exports= seq